<template>
  <!-- 新增、修改班组信息 -->
  <base-modal
    :title="pageType === 'edit' ? '班组设置编辑': '班组设置添加'"
    cancelText="取消"
    okText="保存"
    :width="800"
    v-on="$listeners"
    @ok="handleOk"
    @cancel="handleCancel"
  >
    <a-form :form="formInfo">
      <!-- 第一行(所属分公司、所属项目) -->
      <a-row :gutter="24">
        <a-col :md="12" :sm="12">
          <a-form-item
            label="所属分公司"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <a-select placeholder="请选择所属分公司" v-decorator="['companyName']">
              <!-- <a-select-option value="0">是</a-select-option>
              <a-select-option value="1">否</a-select-option>-->
            </a-select>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="12">
          <a-form-item
            label="所属项目"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <a-select placeholder="请选择所属项目" v-decorator="['projectName']">
              <!-- <a-select-option value="0">是</a-select-option>
              <a-select-option value="1">否</a-select-option>-->
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
      <!-- 第二行(班组名称、所属分包商) -->
      <a-row :gutter="24">
        <a-col :md="12" :sm="12">
          <a-form-item
            label="班组名称"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <BaseInput placeholder="请输入班组名称" v-decorator="['teamName']" />
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="12">
          <a-form-item
            label="所属分包商"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <a-select placeholder="请选择所属分包商" v-decorator="['subBusiness']">
              <!-- <a-select-option value="0">是</a-select-option>
              <a-select-option value="1">否</a-select-option>-->
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
      <!-- 第三行(班组长、状态) -->
      <a-row :gutter="24">
        <a-col :md="12" :sm="12">
          <a-form-item
            label="班组长"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <a-select placeholder="请选择班组长" v-decorator="['teamLeader']">
              <!-- <a-select-option value="0">是</a-select-option>
              <a-select-option value="1">否</a-select-option>-->
            </a-select>
            <a-icon type="user-add" class="select-icon base-btn"/>
          </a-form-item>
        </a-col>
        <a-col :md="12" :sm="12">
          <a-form-item
            label="状态"
            :labelCol="{ lg: { span: 6 }, sm: { span: 5 } }"
            :wrapperCol="{lg: {span: 17}, sm: {span: 17} }"
          >
            <a-select placeholder="请选择状态" v-decorator="['status']">
              <!-- <a-select-option value="0">是</a-select-option>
              <a-select-option value="1">否</a-select-option>-->
            </a-select>
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
  </base-modal>
</template>

<script>
import BaseModal from '@/components/BaseModal'
export default {
    name:'a'+Date.now(),  components: {
    BaseModal,
  },
  data() {
    return {
      pageType: 'add',
      formInfo: this.$form.createForm(this, { name: 'updateForm' }),
    }
  },
  methods: {
    handleCancel() {
      this.$emit('cancel')
    },
    handleOk() {
      this.$emit('ok')
    },
  },
}
</script>

<style lang="less" scoped>
.select-icon {
    margin-left: 12px;
    font-size: 20px;
}
</style>